import { getGoodsListByParam } from './goods';

const historyWords = [
  '春天',
  '新多',
  '防盗门',
  '玻璃门',
  '木门',
  '爱居邦',
  '星月神',
  '密码锁',
  '指纹',
  '面部识别',
];
/**
 * @param {number} sort
 * @param {number} pageNum
 * @param {number} pageSize
 * @param {number} minPrice
 * @param {number} maxPrice
 * @param {string} keyword
 */
export function getSearchHistory() {
  return {
    historyWords: historyWords
  };
}

export function getSearchPopular() {
  return {
    popularWords: historyWords
  };
}

export function getSearchResult(param) {
  let result = getGoodsListByParam(param);
  console.log('getSearchResult: ', param, result)
  return {
    saasId: null,
    storeId: null,
    algId: 0,
    pageNum: result.pageNum,
    pageSize: result.pageSize,
    totalCount: result.total,
    spuList: result.list,
  };
}
